import 'package:flutter/material.dart';
import 'package:hong_vpn_new_20240626/utils/configs/color_config.dart';
import 'package:hong_vpn_new_20240626/utils/configs/text_style_config.dart';
import 'package:hong_vpn_new_20240626/utils/customs/zz_button.dart';

class IndexActionBtnWidget extends StatefulWidget {
  final String title;
  final Image image;
  final Function()? onTap;
  const IndexActionBtnWidget(
      {super.key, required this.image, required this.title, this.onTap});

  @override
  State<IndexActionBtnWidget> createState() => _IndexActionBtnWidgetState();
}

class _IndexActionBtnWidgetState extends State<IndexActionBtnWidget> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        child: Container(
      height: 60,
      padding: const EdgeInsets.only(left: 40, right: 40),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          widget.image,
          const Spacer(),
          Text(
            widget.title,
            style: TextStyleConfig.middle.size(18),
          ),
          const Spacer(),
          ZZButton(
            onTap: widget.onTap,
            width: 40,
            height: 30,
            mainAxisAlignment: MainAxisAlignment.center,
            image: const Icon(Icons.arrow_forward_outlined),
            decoration: const BoxDecoration(
                color: ColorConfig.orange,
                borderRadius: BorderRadius.all(Radius.circular(15))),
          )
        ],
      ),
    ));
  }
}
